<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改跑马灯')" />
	<th:block th:include="include :: select2-css" />
</head>
<body>
    <div class="form-content">
        <form class="form-horizontal" id="form-pmd-edit" th:object="${pmdInfo}">
            <h4 class="form-header h4">基本信息</h4>
            <input name="id" autocomplete="off" id="id"  class="form-control" type="hidden"   th:field="*{id}">
            <div class="row">
            	<div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label"><span style="color: red; ">*</span>速度：</label>
                        <div class="col-sm-8">
                            <input name="speed" id="speed" autocomplete="off" placeholder="请输入速度" class="form-control" type="text"  th:field="*{speed}" >
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label"><span style="color: red; ">*</span>内容：</label>
                        <div class="col-sm-8">
                            <textarea name="content" id="content" class="form-control">[[*{content}]]</textarea>
                        </div>
                    </div>
                </div>
            </div>

            <!--<div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label"><span style="color: red; ">*</span>创建人：</label>
                        <div class="col-sm-8">
                            <input name="createBy" autocomplete="off" placeholder="请输入创建人" class="form-control" type="text"  th:field="*{createBy}" >
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label"><span style="color: red; ">*</span>修改人：</label>
                        <div class="col-sm-8">
                            <input name="updateBy" autocomplete="off" placeholder="请输入修改人" class="form-control" type="text"  th:field="*{updateBy}" >
                        </div>
                    </div>
                </div>
            </div>-->


            <h4 class="form-header h4">其他信息</h4>
            <div class="row">
                <div class="col-sm-12">
                    <div class="form-group">
                        <label class="col-xs-2 control-label">备注：</label>
                        <div class="col-xs-10">
                            <textarea name="remark" id="remark" autocomplete="off"   class="form-control" rows="3">[[*{remark}]]</textarea>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <div class="row">
        <div class="col-sm-offset-5 col-sm-10">
            <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
            <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
        </div>
    </div>
	<th:block th:include="include :: footer" />
	<th:block th:include="include :: select2-js" />
    <script type="text/javascript" src="http://58.40.12.162:18080/ajax/libs/ckeditor/ckeditor.js"></script>
    <script type="text/javascript">
        CKEDITOR.replace('content');

        function submitHandler() {
            if ($.validate.form()) {
                var speed = $("#speed").val();
                var remark = $("#remark").val();
                var id = $("#id").val();
                var content = CKEDITOR.instances.content.getData();
                var addUrl = 'http://58.40.12.162:18080/biz/pmd/editSave';
                var data = speed +"$$" + remark + "$$" + id + "$$" + content;
                $.ajax({
                    type:'POST',
                    data:data,
                    contentType :'application/json;charset=utf-8',
                    dataType:'text',
                    url :addUrl,
                    success: function(result) {
                        result = JSON.parse(result);
                        $.operate.successTabCallback(result);
                    },
                    error :function(e) {
                        // alert("保存失败!");
                    }

                });
            }
        }
    </script>
</body>
</html>